<?php
namespace Home\Controller;
use Think\Controller;

/*
    支付接口调用的方法，此控制器不能继承Init
*/
class PaymentController extends Controller {
        
	/**
	 * 支付返回结果处理
	 * @param [int] $fans_id  [会员主键id]
	 * @param [string] $order_sn [订单号]支付单号
	 */
	public function ReturnPaymentAction($order_id,$order_sn){
		$payorderinfo = M('UserOrder')->where("id = '{$order_id}'")->find();
		if(empty($payorderinfo)){
				return false;
		}
		$data = $payorderinfo;
		return $data;
	}

	/**
	 * 发送直接需要金额转换然会
	 * @param [type] $weid    [description]
	 * @param [type] $fans_id [description]
	 * @param [type] $order_id [description]
	 * @param [type] $host    [description]
	 * @param [array] return    [返货金额以及付款成功跳转链接]
	 */
	public function SendPaymentMoneyCount($order_id){
		//支付地址返回加上参数，有参数进行判断，session升级
		$location = "http://".$_SERVER['HTTP_HOST']."/index.php/Home/Index/index/upgrade/true"; //返回自定地址
		$count = M('UserOrder')->where("id='{$order_id}'")->getField('price');
		return array('host'=>$location,'count'=>$count);
	}
	
}